home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 March / Disc 1 / PCU030201.iso / software / utils / files / activesms.exe / data1.cab / Example_Files / Samples / CPP / CPPDemo.cpp next >
Encoding:
C/C++ Source or Header  |  2001-12-19  |  2.1 KB  |  81 lines

  1. // CPPDemo.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "CPPDemo.h"
  6. #include "CPPDemoDlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CCPPDemoApp
  16.  
  17. BEGIN_MESSAGE_MAP(CCPPDemoApp, CWinApp)
  18.     //{{AFX_MSG_MAP(CCPPDemoApp)
  19.         // NOTE - the ClassWizard will add and remove mapping macros here.
  20.         //    DO NOT EDIT what you see in these blocks of generated code!
  21.     //}}AFX_MSG
  22.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  23. END_MESSAGE_MAP()
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CCPPDemoApp construction
  27.  
  28. CCPPDemoApp::CCPPDemoApp()
  29. {
  30.     // TODO: add construction code here,
  31.     // Place all significant initialization in InitInstance
  32. }
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // The one and only CCPPDemoApp object
  36.  
  37. CCPPDemoApp theApp;
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CCPPDemoApp initialization
  41.  
  42. BOOL CCPPDemoApp::InitInstance()
  43. {
  44.     AfxEnableControlContainer();
  45.  
  46.     // Standard initialization
  47.     // If you are not using these features and wish to reduce the size
  48.     //  of your final executable, you should remove from the following
  49.     //  the specific initialization routines you do not need.
  50.  
  51. #ifdef _AFXDLL
  52.     Enable3dControls();            // Call this when using MFC in a shared DLL
  53. #else
  54.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  55. #endif
  56.  
  57.     CoInitialize ( NULL );
  58.     {
  59.  
  60.         CCPPDemoDlg dlg;
  61.         m_pMainWnd = &dlg;
  62.         int nResponse = dlg.DoModal();
  63.         if (nResponse == IDOK)
  64.         {
  65.             // TODO: Place code here to handle when the dialog is
  66.             //  dismissed with OK
  67.         }
  68.         else if (nResponse == IDCANCEL)
  69.         {
  70.             // TODO: Place code here to handle when the dialog is
  71.             //  dismissed with Cancel
  72.         }
  73.  
  74.     }
  75.     CoUninitialize();
  76.  
  77.     // Since the dialog has been closed, return FALSE so that we exit the
  78.     //  application, rather than start the application's message pump.
  79.     return FALSE;
  80. }
  81.